# 导包
import jsonschema
# 准备被测数据
data = {
    "success": True,
    "code": 10000,
    "message": "操作成功",
    "data": None
}

# 编写 schema
schema = {
    "type": "object",
    "properties": {
        "success": {"const": True},
        "code": {"const": 10000},
        "message": {"const": "操作成功"},
        "data": {"const": None}
    }
}


# 调用validate校验数据
result = jsonschema.validate(instance=data,schema=schema)
print(result)